import {post} from "./axios";
import fa from "element-ui/src/locale/lang/fa";

const task = {
    queryUrl: '/v1/task/findMany',
    submitUrl: '/v1/task/upsert',
}

/**
 *
 * @param filter
 * @param page
 * @param pageSize
 * @returns {Promise<AxiosResponse<any>>}
 */
export function queryHandler(filter = {}, page = 1, pageSize = 10) {
    let data = {
        filter: filter,
        page: page,
        page_size: pageSize,
    }
    return post(task.queryUrl, data, {}, true, false)
}

export function upsertOneHandler(data = {}) {
    return post(task.submitUrl, data, {}, true, false)
}